<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>添加用户</title>
<link href="<{$ipath}>user/style/my_account_css.css" type="text/css" rel="stylesheet">
<link href="<{$ipath}>user/style/my_service_css.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src='<{$ipath}>app/hotel/js/My97DatePicker/WdatePicker.js'></script>
    <script src="<{$ipath}>app/hotel/js/jquery-1.9.1.min.js"></script>
    <script>
    $(document).ready(function(e) {
        /*保存按钮*/
		$(".baocun").mouseover(function(){
			$(this).addClass("add_baocun")
			})
			$(".baocun").mouseleave(function(){
			$(this).removeClass("add_baocun")
			});
    });
    </script>
</head>
<body>
<div class="servicebox">
    <!--内容-->
    <div class="content01">
    	<div class="caibox">
    	<p class="title">添加客户</p>
        <div class="content_merchant hotel_border">
            <!--表单部分-->
            <div class="hide_content">
            	<div class="company_01">
                    <form action="?g=user&m=member&a=addUser" method="post" onsubmit="return checkfrm();">
                    <!--复制-->
                    <div class="div_01">
                        <span><span class="red">*</span>搜&nbsp;悦&nbsp; 号：</span>
                        <input name="username" type="text" class="div_input"/> 
                    </div>

                    <!--客户名称-->
                    <div class="div_01">
                        <span><span class="red">*</span>&nbsp;&nbsp;客户名称：</span>
                        <input name="clientname" type="text" class="div_input"/>
                    </div>

                    <!--应用名称-->
                    <div class="div_01">
                        <span><span class="red">*</span>&nbsp;&nbsp;应用名称：</span>
                        <input name="appname" type="text" class="div_input"/>
                    </div>

                    <!--密码-->
                    <div class="div_01" style="display: none;">
                        <span><span class="red">*</span>密　　码：</span>
                        <input name="password" value="123456" type="password" class="div_input"/>
                    </div>
                    <!--版本-->
                    <div class="div_01">
                            <span><span class="red">*</span>&nbsp;&nbsp;版　　本：</span>
                            <{foreach from=$groups item=v key=k}>
                            <input type="checkbox" name="hytype[]" <{if $k==2}>checked='checked' onclick="return false;"<{/if}> class="pingtai" value="<{$k}>"/><{$v}><i class="pingtai"></i>
                            <{/foreach}>
                    </div>
                    <!--平台-->
                    <div class="div_01">
                        <span><span class="red">*</span>&nbsp;&nbsp;平　　台：</span>
                        <{foreach from=$plas item=vv key=kk}>
                        <input type="checkbox" name="plas[]" class="pingtai" value="<{$kk}>"/><{$vv}><i class="pingtai"></i>
                        <{/foreach}>  
                    </div>
                    <!--三级域名-->
                    <div class="div_01">
                        <span><span class="red">*</span>&nbsp;&nbsp;三级域名：</span>
                        <input name="three_domain" type="text" class="div_input"/> 
                    </div>


					<!--到期时间-->
                    <div class="div_01">
                        <span><span class="red">*</span>&nbsp;&nbsp;到期时间：</span>
                        <input type="text" name="end_time" onClick="WdatePicker({startDate:'',dateFmt:'yyyy-MM-dd HH:mm'})" class="div_input"/> 
                    </div>
                    <div class="baocunbox">
                        <input type="submit" value="提交" class="baocun"/>
                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
 <script type="text/javascript">
function checkName(name) {
    return (/^[0-9a-zA-Z_]{6,18}$/.test(name));
}
function checkPwd(value) {
	var Regx = /^(.){6,18}$/;
	return (Regx.test(value))
}

function checkfrm(){
	var uname = $("input[name='username']").val(),
		pwd = $("input[name='password']").val(),
		time = $("input[name='end_time']").val(),
        three_main = $("input[name='three_domain']").val();

	if(uname=='' || uname==null){
		alert("请输入搜悦号");
		return false;
	}
    if(three_main=='' || three_main==null){
        alert("请输入三级域名");
        return false;
    }
	if(!checkName(uname)){
		alert('搜悦号必须为6到18位字母或者数字');
		return false;
	}
//	if(pwd=='' || pwd==null){
//		alert('请输入密码');
//		return false;
//	}
//	if(!checkPwd(pwd)){
//		alert('密码为6到15位');
//		return false;
//	}
//    if(pwd.indexOf(" ") >=0){
//        alert('密码不能含有空格');
//        return false;
//    }
	if(time=='' || time==null){
		alert("请填写到期时间");
		return false;
	}

    var chks=$('.pingtai');
    var bl=true;
    for(var i=0;i<chks.length;i++)
    {
        if(chks[i].checked)
        {
            bl=false;
            break;
        }
    }
    if(bl){
        alert('最少选择一个平台');
        return false;
    }
}

</script>
   
</div>
</div>
</body>
</html>